using System;
using DslCrossModelFramework.ModelTraversal;
using DslCrossModelFramework.ModelRelationship;

namespace DslCrossModelFramework.UI {
    public class CrossModelBrowserDialog<TProxyElement> : ModelBrowserDialogTypeEditor where TProxyElement : class, ICrossModelProxyElement {
        protected override void ConfigureDialog(ModelElementTreeDialog dialog) {
            base.ConfigureDialog(dialog);
            dialog.AllowSelectNone = false;
            dialog.SelectionMode = ModelSelectionMode.ModelElement;
            dialog.SelectionFilters.Add(new ModelElementProxyFilter<TProxyElement>(this.TypeDescriptor.ModelElement as TProxyElement));
            dialog.ExcludedStores.Add(this.TypeDescriptor.ModelElement.Store.Id);
        }
    }
}